package com.qf.pojo;


import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * @author sunyamei
 * @version V1.0
 * @Project springmvc_Demo
 * @Package com.qf.pojo
 * @Description:
 * @Date 2022/7/14 9:38
 */
public class MyJsonSerializer  extends JsonSerializer<Double> {
    @Override
    public void serialize(Double aDouble, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
            jsonGenerator.writeString("$" +aDouble+"元");
    }
}
